{literal}
<script type="text/javascript">
<!--
function uninstall(articleId) {
if (confirm("This will uninstall the template from the database. Continue?")){/literal}
document.location = "{$pagename}&action=uninstall&id=" + articleId;{literal}
}

function installtheme(articleId)
{
    if (confirm("This will install the template into the database. Continue?")){/literal}
    document.location = "{$pagename}&action=install&id=" + articleId;{literal}
}

//-->
</script>
{/literal}
{if $numinstalledthemes > 0}
<h2>Installed Templates</h2>
<table width="100%" border="0" cellspacing="1" cellpadding="4" align="center" class="table">
  <tr valign="top"> 
    <th width="10%" class="smallhead">Action</th>
    <th class="smallhead">Theme Name</th>
  </tr>
 {section name=themeloop loop=$numinstalledthemes}
	  <tr valign="middle"> 
		<td width="10%" class="text"><input type="button" class="button" value="Uninstall" onclick="uninstall('{$installedthemes[themeloop].id}')" /></td>
		<td class="text"><a href="index.php?theme={$installedthemes[themeloop].id}" title="Preview template" target="_blank">{$installedthemes[themeloop].name}</a></td>
	  </tr>  
	{/section}
</table>
{else}
<div align="center">No installed templates</div>
{/if}
{if $numnotinstalled > 0}
<br /><br />
<h2>Templates available to install</h2>
<table width="100%" border="0" cellspacing="1" cellpadding="4" align="center" class="table">
  <tr valign="top"> 
    <th width="10%" class="smallhead">Action</th>
    <th class="smallhead">Theme Name</th>
  </tr>
 {section name=themeloop loop=$numnotinstalled}
	  <tr valign="middle"> 
		<td width="10%" class="text"><input type="button" class="button" value="Install" onclick="installtheme('{$notinstalled[themeloop].directory}')" /></td>
		<td class="text">{$notinstalled[themeloop].theme_name}</td>
	  </tr>  
	{/section}
</table>
{else}
<div align="center">No templates available to install</div>
{/if}
<div align="center">
 <a href="http://www.cmscout.za.net/index.php?page=subsite&amp;site=Manual&amp;content=adminpanel-template" target="_blank">Help</a>
</div>
